import fetch from 'common/src/utils/fetch';

function getCreditAffirmBkList(data){//校内学分列表
    return fetch({
       url:'/api/scoremanagementservice/scoreManageController/getCreditAffirmBkList',
       method:'post',
       data
    })
}
function selectStudentScoreDataBk(data){//获取已认定学分
    return fetch({
        url:`/api/scoremanagementservice/scoreManageController/selectStudentScoreDataBk?studentId=${data.studentId}&courseCode=${data.courseCode}&id=${data.id}`,
        method:'get',
    })
}
function getDstCourseList(data){//获取已认定学分
    return fetch({
        url:`/api/scoremanagementservice/scoreManageController/getDstCourseList?studentId=${data.studentId}&courseCode=${data.courseCode}&id=${data.id}&affirmType=${data.affirmType}`,
        method:'get',
    })
}
function getStuInfoByStudentId(data){//获取学生信息
  return fetch({
      url:`/api/scoremanagementservice/scoreManageController/getStuInfoByStudentId?studentId=${data}`,
      method:'get',   
  })
}
function applyCreditAffirmBk(data){//学分认定申请
    return fetch({
        url:'/api/scoremanagementservice/scoreManageController/applyCreditAffirmBk',
        data,
        method:'post'
    })
}
//查看审批进展
function querySocreChangeFlowInfo (data){
    return fetch({
        url:`/api/scoremanagementservice/studentScoreChange/querySocreChangeFlowInfo?no=${data}`,
        method:'get'
    })
   
    
}
//审核列表
function getCreditAffirmAuditedList(data){//校内学分列表
    return fetch({
       url:'/api/scoremanagementservice/scoreManageController/getCreditAffirmAuditedList',
       method:'post',
       data
    })
}
//指定录入人
function setAuditTeacher(data){
  return fetch({
      url:'/api/scoremanagementservice/scoreManageController/setAuditTeacher',
      method:'post',
      data
  })
}
//取消指定录入人
function cancelAuditTeacher(data){
    return fetch({
        url:'/api/scoremanagementservice/scoreManageController/cancelAuditTeacher',
        method:'post',
        data
    })
}
function recall(data){//撤回
   return fetch({
       url:'/api/workflow/approval/recall',
       method:'post',
       data
   })
}

function isCanApply(data){
    return fetch({
        url:`/api/scoremanagementservice/scoreManageController/isCanApply?affirmType=${data}`,
        method:'get'

    })
}
//校外查询是否在学生名单

function  queryCurrentUser(studentId){
    return fetch({
        url:`/api/scoremanagementservice/transferredAndPreppyController/queryCurrentUser?studentId=${studentId}`,
        method:'get'
    })
}
function getCreditAffirmOutBkList(data){//校外学分认定申请列表
    return fetch({
        url:'/api/scoremanagementservice/scoreManageController/getCreditAffirmOutBkList',
        data,
        method:'post'
    })

}
function getCreditAffirmOutAuditListBk(data){//校外审核列表
    return fetch({
        url:'/api/scoremanagementservice/scoreManageController/getCreditAffirmOutAuditListBk',
        data,
        method:'post'
    })
}
function queryContainStudent(studentId){
    return fetch({
        url:`/api/scoremanagementservice/transferredAndPreppyController/queryContainStudent?studentId=${studentId}`,
        method:'get'
    })
}

function getScopeTypeList(data) { // 成绩记录方式对应的值
    return fetch({
        url: '/api/scoremanagementservice/scoreSettingController/queryScoreRecord?coretypeCode=' + data + '&projectId=1',
        method: 'get'
    });
}
//更新成绩
function reviewCreditAffirmBk(data){
    return fetch({
        url:'/api/scoremanagementservice/scoreManageController/reviewCreditAffirmBk',
        data,
        method:'post'
    })
}
export default {
    getCreditAffirmBkList,
    selectStudentScoreDataBk,
    getDstCourseList,
    getStuInfoByStudentId,
    applyCreditAffirmBk,
    querySocreChangeFlowInfo,
    getCreditAffirmAuditedList,
    setAuditTeacher,
    cancelAuditTeacher,
    recall,
    isCanApply,
    getCreditAffirmOutBkList,
    queryCurrentUser,
    getCreditAffirmOutAuditListBk,
    queryContainStudent,
    getScopeTypeList,
    reviewCreditAffirmBk
    
};
